package com.ayf.payment.game.api.mapper;

import com.ayf.payment.game.api.dto.MerchantPayOrderDTO;
import com.ayf.payment.game.api.dto.criteria.BatchPayInfoCriteria;
import com.ayf.payment.game.api.dto.criteria.CleanCriteria;
import com.ayf.payment.game.api.dto.criteria.MerchantPayOrderCriteria;
import com.ayf.payment.game.api.dto.criteria.OrderInfoCriteria;
import com.ayf.payment.game.api.dto.platform.BatchPayInfoDTO;
import com.ayf.payment.game.api.entity.MerchantPayOrder;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface MerchantPayOrderMapper extends Mapper<MerchantPayOrder> {

    MerchantPayOrder getMerchantPayOrderByMerchantOrderNo(@Param("merchantOrderNo") String merchantOrderNo);

    List<MerchantPayOrderDTO> getMerchantPayOrderListByPage(MerchantPayOrderCriteria merchantPayOrderCriteria);

    /**
     * 查询商户代付汇总信息
     *
     * @param cri
     * @return
     */
    @MapKey("merchant_id")
    Map<Integer, Map<String, Object>> selectSumPay(@Param("cri") OrderInfoCriteria cri);

    /**
     * 清理代付信息
     *
     * @param clean
     * @return
     */
    int cleanPayOrder(@Param("clean") CleanCriteria clean);

    /**
     * 批量添加代付信息
     *
     * @param successList
     * @return
     */
    int bathAddPay(@Param("list") List<MerchantPayOrder> successList);

    List<BatchPayInfoDTO> selectBatchPayInfo(@Param("bp") BatchPayInfoCriteria criteria);
    List<MerchantPayOrderDTO> selectBatchPayOrder(@Param("status") Integer status);

    MerchantPayOrder getMerchantPayOrderByChannelOrderNo(@Param("channelOrderNo") String channelOrderNo);

}